<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Simpla Admin</title>
<include file="Admin:Resources" />
<script>
$(document).ready(function(){

	//var obj = $('.table_row').children(".drag_span:last-child").find('a').eq(-2).html(); 
	
	var auth = '<?php echo  getAuth('admin');  ?>';
	//alert(auth);
	
	if(auth=='style="display:none;"'){
		
		$('#cm_batch_dels').css({'display':'none'});
	}
	//
	
	
	KindEditor.ready(function(K) {
		
		$('.table_row').each(function(){
				
			var _This = $(this);
			
			var obj =  _This.children(".drag_span:last-child").find('a').eq(-1); 
			
			var dayinObj =  _This.children(".drag_span:last-child").find('a').eq(-2); 
			
			//_This.children(".drag_span:last-child").find('a').eq(1).css({'display':'none'});
			
			dayinObj.click(function(){
				
				//if(!confirm('打印报名表会锁定,确定执行该操作？')){
					
					//return false;
				//}else{
					window.open($(this).attr('href')); return false;
				//}
			});
			var obj2 = null;
				
			obj.click(function(){
			
				var href = $(this).attr('href');	//alert(href);
				//window.open(href); return false;
			});
			
			
			
			
		});	
		
		
		String.prototype.gblen = function() {  
		 var len = 0;  
		  for (var i=0; i<this.length; i++) {  
			if (this.charCodeAt(i)>127 || this.charCodeAt(i)==94) {  
			   len += 2;  
			 } else {  
			   len ++;  
			 }  
		   }  
		  return len;  
		}

		$("body").delegate(".acti_times","change",function(){
			
			var val = $(this).val(); 
			
			$.post('__APP__/Student/getNums',{'acti_time_id':val},function(data){
				
				$('#mess_num').html(data);
				$('#mess_num2').html(data);
				
				if(parseInt(data)<=100){
					
					$('#mess').css({'display':'block'});
				}else{	
					$('#mess').css({'display':'none'});
				}
				
			});
		});
		
		
		var str = $('#aaa').html();
		
		K('#fenGroup').click(function() {	
			var dialog = K.dialog({
				width : 500,
				title : '条件分组',
				body : '<div style="margin:10px;"  >移动到的分组：<select id="yiGID"><option value="0">--请选择移动到的分组--</option><?php foreach($groupList as $val){ ?><option value="{$val['grouping_id']}">{$val['title']}</option><?php } ?></select></div>',
				closeBtn : {
					name : '关闭',
					click : function(e) {
						dialog.remove();
					}
				},
				yesBtn : {
					name : '确定分组',
					click : function(e) {
					
						var mt_res = $('.search_ul_tt').find('input[name="mt_res"]').val(); 
						var yiGID  = $('#yiGID').val(); 
						
						var ids = '';
		
						$('.cm_list_check').each(function(){
							
							if($(this).attr('checked')=='checked'){
							
								ids+=$(this).attr('value')+',';
							}
							
						});
						
						ids = ids.substr(0,ids.length-1);
						
						//ids = encodeURIComponent(ids);
						
						var dataQue = {};
						dataQue.mt_res  	 = mt_res;
						dataQue.grouping_id  = yiGID;
						dataQue.ids 		 = ids;
							
						console.log(dataQue);
						$.post('__APP__/Student/multiGroup',dataQue,function(data){
							alert('操作成功');
							dialog.remove();
						});	
					}
				},
				noBtn : {
					name : '取消',
					click : function(e) {
						dialog.remove();
					}
				}
			});
		});
		
	});
	
	
	
});
</script>
</head>
<body>
<!--
<div style="margin:10px;" id="aaa" >
	<div style="margin:10px;"  >
		<select>
			<option value="0">--请选择移动到的分组--</option>
			<?php foreach($groupList as $val){ ?>
			
			<option value="{$val['grouping_id']}">{$val['title']}</option>
			
			<?php } ?>
		</select>
	</div>
</div>
-->	
<div style="-display:none;" id="mess_num2"></div>
<!--
	<div id="myDialog">
		<div style="margin:10px; text-align:center;">
			面谈分组号：<input name="" value="" /><br>
			选择时段：
			<select style="min-width:180px;" name="">
				<?php foreach($actiTimes as $val){ ?>
				<option value="{$val['acti_time_id']}" >{$val['title']}</option>
				<?php } ?>
				
			</select>
		</div>
	</div>
-->
	<div id="body-wrapper" style="margin-top:20px;"> 
		<div id="main-content"> 
			<div class="content-box">
				
				<div class="content-box-header">
					
					<h3>列表 </h3>
					
					<ul id="my_tab">
						<li <?php echo  getAuth('excel');  ?> id="fenGroup" ><a>条件分组&nbsp;&nbsp;&nbsp;</a></li>
						<li <?php echo  getAuth('excel');  ?> id="fenGroup2" cm_href="__APP__/Student/changes" ><a >转为当前招生学生&nbsp;&nbsp;&nbsp;</a></li>
						<li <?php echo  getAuth('excel');  ?> >{$excel_btn}</li>
						
						<li>&nbsp;{$add_btn}</li>
					</ul>
					<div class="clear"></div>
				</div> 
				
				{$searchForm}
				<div class="content-box-contenta">
					
					{$list}
				</div> 
				
			</div>
		<div class="clear"></div>
			
		</div> 
</div>
	<script>
	
	
	$('#fenGroup2').click(function(){
		
		if(confirm('您确定将当前选中的学生操作为正式报名学生？')){
			
			 var ids = '';
		
			$('.cm_list_check').each(function(){
				
				if($(this).attr('checked')=='checked'){
				
					ids+=$(this).attr('value')+',';
				}
				
			});
			
			ids = ids.substr(0,ids.length-1);
			
			ids = encodeURIComponent(ids);
			
			var href = $(this).attr('cm_href');
			
			window.location.href=href+'/ids/'+ids;
		}
	   
	});
	
	</script>
</body>
</html>
